<div id="right">
	
	<div id="loginArea" style="border:solid 1px #0099CC ; padding:2px;margin:2px; color : #0099CC;font-weight:bold;">
		<?php if(!isset($_SESSION["username"])){?>
			<h1 class="category"> ĐĂNG NHẬP </h1>
			<div class="errorShow" style="color:red"></div>
			<form id="loginForm" name="loginForm">
				<table id = "loginTable">
					<tr>
						<td>Username : </td><td><input size="16" type="text" id="username" name = "username" ></td>
					</tr>
					<tr>
						<td>Password : </td><td><input size="16"  type="password"  id ="password" name="password"></td>
					</tr>
					<tr><td colspan="2"><input type="button" value="Login" style="margin-left:65px;" onclick="doLogin();"></td></tr>
				</table> 
			</form>
		<?php }else{?>
			Welcome <?php echo $_SESSION["username"];?>
			<a href="act/doLogout.php">Log out</a>
			
		<?php }?>
	</div>
	<div class = "category">
		<div id="mainNav">
			<h1 class="category">DANH MỤC</h1>
			<ul>
				<?php
					$sql = "SELECT * FROM tb_category WHERE cate_parent_status= 0";
					$query = mysql_query($sql);
						while ($data = mysql_fetch_array($query) ):?>
								<li>
									<a href='<?php echo $data['cate_link'].'?page=1&cate_father='.$data["cate_id"];?>' title='loai'><?php echo $data["cate_name"]?></a>
									<ul>
										<?php
										$sql_child = "SELECT * FROM tb_category WHERE cate_parent_id= $data[cate_id]";
										$query_child = mysql_query($sql_child);
										while ($data_child = mysql_fetch_array($query_child) ):
										?>
										<li>
											<a href='<?php echo $data_child['cate_link'].'?cate_id='.$data_child["cate_id"].'&page=1'?>'><?php echo $data_child["cate_name"]?></a>
										</li>
										<?php endwhile;?>
										
									</ul>
								</li>
						<?php endwhile;?>

			</ul>
		</div>
	</div>
	<div class="video">
	<?php 

		if(!isset($_GET["page"])){
	?>
    <iframe width="228" height="200" src="http://www.youtube.com/embed/rANFhi7oYp4" frameborder="0" allowfullscreen></iframe>
    <?php } else{
    	if( $_GET["page"] == "" || $_GET["page"]== "index"){
    		?>
    		<iframe width="228" height="200" src="http://www.youtube.com/embed/rANFhi7oYp4" frameborder="0" allowfullscreen></iframe>
    	<?php }
    }
    ?>
    </div>
    <div class="quangcao">
    	<div class="title"><img src="style/images/quangcao.jpg" width="228px" /></div>
        <div class="content">
        <img src="style/images/ads4.jpg" width="220px" />
        <img src="style/images/ads3.jpg" width="220px" />
        </div>
    </div>
</div>